package com.yqz.bussi.controller;

import com.yqz.bussi.form.BussiBookingCustomerForm;
import com.yqz.bussi.query.BussiBookingCustomerQuery;
import com.yqz.bussi.service.BussiBookingCustomerService;
import com.yqz.common.base.controller.BaseController;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("bussi/customer")
public class BookingCustomerController extends BaseController<BussiBookingCustomerQuery, BussiBookingCustomerForm> {

    @Autowired
    private BussiBookingCustomerService bussiBookingCustomerService;

    public BookingCustomerController(BussiBookingCustomerService bussiBookingCustomerService) {
        super(bussiBookingCustomerService);
    }

    @RequestMapping("add.do")
    public Object add(BussiBookingCustomerForm form){
        return bussiBookingCustomerService.add(form);
    }

    @RequestMapping("update.do")
    public Object update(BussiBookingCustomerForm form){
        return bussiBookingCustomerService.update(form);
    }

    @RequestMapping("updateUser.do")
    public Object updateUser(@RequestParam("custId") List<Integer> custId,@RequestParam("userId") Integer userId,@RequestParam("userName") String userName){
        return bussiBookingCustomerService.updateCustomerUser(custId,userId,userName);
    }

    @RequestMapping("using.do")
    public Object using(@RequestParam("id") Integer id){
        return bussiBookingCustomerService.usingCustomer(id);
    }

}
